package com.bjc.platform.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "adm_resource")
public class AdmResource extends BaseObject implements Serializable {
	private String id;
	private String resType;
	private String resTable;
	private String resGroupField;
	private String resOrgField;
	private String remark;
	private Long creator;
	private Date createTime;
	private Long updater;
	private Date updateTime;
	private String flag;

	@Id
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "res_type", nullable = false, length = 20)
	public String getResType() {
		return this.resType;
	}

	public void setResType(String resType) {
		this.resType = resType;
	}

	@Column(name = "res_table", length = 30)
	public String getResTable() {
		return this.resTable;
	}

	public void setResTable(String resTable) {
		this.resTable = resTable;
	}

	@Column(name = "res_group_field", length = 64)
	public String getResGroupField() {
		return this.resGroupField;
	}

	public void setResGroupField(String resGroupField) {
		this.resGroupField = resGroupField;
	}

	@Column(name = "res_org_field", length = 64)
	public String getResOrgField() {
		return this.resOrgField;
	}

	public void setResOrgField(String resOrgField) {
		this.resOrgField = resOrgField;
	}

	@Column(name = "remark", length = 600)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "creator", nullable = false, columnDefinition="int")
	public Long getCreator() {
		return this.creator;
	}

	public void setCreator(Long creator) {
		this.creator = creator;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", nullable = false, length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(columnDefinition="int", name = "updater")
	public Long getUpdater() {
		return this.updater;
	}

	public void setUpdater(Long updater) {
		this.updater = updater;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_time", length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "flag", nullable = false, length = 1)
	public String getFlag() {
		return this.flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		AdmResource pojo = (AdmResource) o;

		if (resType != null ? !resType.equals(pojo.resType)
				: pojo.resType != null)
			return false;
		if (resTable != null ? !resTable.equals(pojo.resTable)
				: pojo.resTable != null)
			return false;
		if (resGroupField != null ? !resGroupField.equals(pojo.resGroupField)
				: pojo.resGroupField != null)
			return false;
		if (resOrgField != null ? !resOrgField.equals(pojo.resOrgField)
				: pojo.resOrgField != null)
			return false;
		if (remark != null ? !remark.equals(pojo.remark) : pojo.remark != null)
			return false;
		if (creator != null ? !creator.equals(pojo.creator)
				: pojo.creator != null)
			return false;
		if (createTime != null ? !createTime.equals(pojo.createTime)
				: pojo.createTime != null)
			return false;
		if (updater != null ? !updater.equals(pojo.updater)
				: pojo.updater != null)
			return false;
		if (updateTime != null ? !updateTime.equals(pojo.updateTime)
				: pojo.updateTime != null)
			return false;
		if (flag != null ? !flag.equals(pojo.flag) : pojo.flag != null)
			return false;

		return true;
	}

	public int hashCode() {
		int result = 0;
		result = (resType != null ? resType.hashCode() : 0);
		result = 31 * result + (resTable != null ? resTable.hashCode() : 0);
		result = 31 * result
				+ (resGroupField != null ? resGroupField.hashCode() : 0);
		result = 31 * result
				+ (resOrgField != null ? resOrgField.hashCode() : 0);
		result = 31 * result + (remark != null ? remark.hashCode() : 0);
		result = 31 * result + (creator != null ? creator.hashCode() : 0);
		result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
		result = 31 * result + (updater != null ? updater.hashCode() : 0);
		result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
		result = 31 * result + (flag != null ? flag.hashCode() : 0);

		return result;
	}

	public String toString() {
		StringBuffer sb = new StringBuffer(getClass().getSimpleName());

		sb.append(" [");
		sb.append("id").append("='").append(getId()).append("', ");
		sb.append("resType").append("='").append(getResType()).append("', ");
		sb.append("resTable").append("='").append(getResTable()).append("', ");
		sb.append("resGroupField").append("='").append(getResGroupField())
				.append("', ");
		sb.append("resOrgField").append("='").append(getResOrgField())
				.append("', ");
		sb.append("remark").append("='").append(getRemark()).append("', ");
		sb.append("creator").append("='").append(getCreator()).append("', ");
		sb.append("createTime").append("='").append(getCreateTime())
				.append("', ");
		sb.append("updater").append("='").append(getUpdater()).append("', ");
		sb.append("updateTime").append("='").append(getUpdateTime())
				.append("', ");
		sb.append("flag").append("='").append(getFlag()).append("'");
		sb.append("]");

		return sb.toString();
	}

}
